package com.leaf.u_spring.chapter01;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 基于Java的配置
 * 
 * @Configuration注解表明这个类是一个配置类，该类应该包含在Spring应用上下文中如何创建bean的细节
 */
@Configuration
public class KnightConfig {

	@Bean
	public Knight knight(){
		return new BraveKnight(quest());
	}
	
	@Bean
	public Quest quest(){
		return new SlayDragonQuest(System.out);
	}
}


